import { ImageWall, spuSaleAttrData } from '../spu/type'

export interface ResponseSku {
  code: number
  message: string
  ok: boolean
}
export interface AttrValue {
  valueName: any
  attrName?: string
  //sku平台属性值和属性id
  attrId: number | string
  valueId: number | string
}
export interface SaleValue {
  saleAttrId: number | string
  saleAttrValueId: number | string
}
export interface SkuRecords {
  id: number
  spuId: number
  price: number
  skuName: string
  skuDesc: string
  weight: string
  tmId: number
  category3Id: number
  skuDefaultImg: string
  isSale: number
  load: boolean
}
export interface skuData {
  records: SkuRecords[]
  total: number
  size: number
  current: number
  orders: []
  optimizeCountSql: true
  hitCount: false
  countId: null
  maxLimit: null
  searchCount: true
  pages: number
}
export interface SkuResponseData extends ResponseSku {
  data: skuData
}
export interface getSku {
  id?: number
  category3Id: number | string //三级分类id
  spuId: number | string //对应的spu的id
  tmId: number | string
  skuName: string
  price: number | string
  weight: number | string
  skuDefaultImg: string
  skuDesc: string
  skuAttrValueList: AttrValue[]
  skuSaleAttrValueList: SaleValue[]
  skuImageList: ImageWall[]
}
export interface SkuResponseInfo extends ResponseSku {
  data: getSku
}
export interface getNewSku {
  id?: number
  category3Id: number | string //三级分类id
  spuId: number | string //对应的spu的id
  tmId: number | string
  skuName: string
  price: number | string
  weight: number | string
  skuDefaultImg: string
  skuDesc: string
  skuAttrValueList: AttrValue[]
  skuSaleAttrValueList: spuSaleAttrData[]
  skuImageList: ImageWall[]
}
export interface getSkuResponseInfo extends ResponseSku {
  data: getNewSku
}
